An officer was saved from a suspect's bullet by his own badge when gunfire broke out after police responded to a domestic dispute call.